package com.ynkbny.web.controller;

import com.ynkbny.base.PageResult;
import com.ynkbny.domain.TaskLog;
import com.ynkbny.domain.User;
import com.ynkbny.service.TaskLogService;
import com.ynkbny.util.Res;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 杨亚
 * @version 1.0.0
 * @title TaskLogController
 * @description <ToDo description class purpose>
 * @create 2023/11/16 14:33
 **/
@Api(tags = "任务调度日志接口")
@RestController
@RequestMapping("/taskLog")
public class TaskLogController {

    @Resource
    private TaskLogService taskLogService;

    @ApiOperation("任务调度日志分页查询")
    @PostMapping("/pageList")
    public Res<PageResult<TaskLog>> pageList(@RequestParam(name = "pageNum", required = false, defaultValue = "1") int pageNum,
                                             @RequestParam(name = "pageSize", required = false, defaultValue = "15") int pageSize,
                                             @RequestParam(name = "condition", required = false) String conditionJson) {
        return Res.ok(taskLogService.pageList(conditionJson, pageNum, pageSize));
    }
}
